﻿using System;
using System.Collections.Generic;
using System.Data;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class control_common_TopSupportOnline : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {

        }
    }
    protected string GetYahooDl()
    {
        string htmlCode = "";
        DataTable tbl = DataAccess.ExeSQLToDataTable("select top(2) * from Yahoo where Check_Skype_Yahoo=1 and Check_DuLich_VeMB=11 and status =1  order by IdYahoo desc");

        if (tbl.Rows.Count > 0)
        {
            foreach (DataRow dr in tbl.Rows)
            {
                htmlCode += @"<a href='ymsgr:sendim?" + dr["Nick"] + @"' style='text-decoration: none;' title='Y!M: " + dr["Nick"] + @"'>
                                <img class='div-imgYM' alt=''
                                    src='http://opi.yahoo.com/online?u=" +dr["Nick"]+@"&m=g&t=1' border='0' title='Y!M: "+dr["Nick"]+@"'>
                            </a>";
            }
        }
        return htmlCode;
    }

    protected string GetYahooVeMB()
    {
        string htmlCode = "";
        DataTable tbl = DataAccess.ExeSQLToDataTable("select top(2) * from Yahoo where Check_Skype_Yahoo=1 and Check_DuLich_VeMB=22 and status =1  order by IdYahoo desc");

        if (tbl.Rows.Count > 0)
        {
            foreach (DataRow dr in tbl.Rows)
            {
                htmlCode += @"<a href='ymsgr:sendim?" + dr["Nick"] + @"' style='text-decoration: none;' title='Y!M: " + dr["Nick"] + @"'>
                                <img class='div-imgYM' alt=''
                                    src='http://opi.yahoo.com/online?u=" + dr["Nick"] + @"&m=g&t=1' border='0' title='Y!M: " + dr["Nick"] + @"'>
                            </a>";
            }
        }
        return htmlCode;
    }

    protected string GetSkypeDl()
    {
        string htmlCode = "";
        DataTable tbl = DataAccess.ExeSQLToDataTable("select top(1) * from Yahoo where Check_Skype_Yahoo=2 and Check_DuLich_VeMB=33 and status =1  order by IdYahoo desc");

        if (tbl.Rows.Count > 0)
        {
            foreach (DataRow dr in tbl.Rows)
            {
                htmlCode += @"<div id='SkypeButton_Dropdown_" + dr["Nick"] + @"_1'>
                                <script type='text/javascript'>
                                    Skype.ui({
                                            'name': 'dropdown',
                                            'element': 'SkypeButton_Dropdown_" + dr["Nick"] + @"_1',
                                            'participants': ['" + dr["Nick"]+ @"']
                                        });
                                </script>
                            </div>";
            }
        }
        return htmlCode;
    }
    protected string GetSkypeVeMB()
    {
        string htmlCode = "";
        DataTable tbl = DataAccess.ExeSQLToDataTable("select top(1) * from Yahoo where Check_Skype_Yahoo=2 and Check_DuLich_VeMB=44 and status =1  order by IdYahoo desc");

        if (tbl.Rows.Count > 0)
        {
            foreach (DataRow dr in tbl.Rows)
            {
                htmlCode += @"<div id='SkypeButton_Dropdown_" + dr["Nick"] + @"_1'>
                                <script type='text/javascript'>
                                    Skype.ui({
                                            'name': 'dropdown',
                                            'element': 'SkypeButton_Dropdown_" + dr["Nick"] + @"_1',
                                            'participants': ['" + dr["Nick"] + @"']
                                        });
                                </script>
                            </div>";
            }
        }
        return htmlCode;
    }
    protected string GetHotLine()
    {
        string htmlCode = "";
        DataTable tbl = DataAccess.ExeSQLToDataTable("select top(1) * from Yahoo where Check_Hotline = 3 and status =1  order by IdYahoo desc");

        if (tbl.Rows.Count > 0)
        {
            foreach (DataRow dr in tbl.Rows)
            {
                htmlCode += @"<a class='titleHotline'>Hotline</a><a class='phoneHotline'>" + dr["Name"] + @"</a>";
            }
        }
        return htmlCode;
    }
}